cssanimatedstyle: Keep transition_info_add from recursing
authorTimm Bäder <mail@baedert.org>
Thu, 22 Aug 2019 11:14:57 +0000 (13:14 +0200)
committerTimm Bäder <mail@baedert.org>
Mon, 9 Sep 2019 15:36:24 +0000 (17:36 +0200)
The slowest part of that fuction is the type check for
GtkCssShorthandProperty. Subproperties of shorthand properties never
refer to more shorthand properties however, so we don't want to have the
type check for those.

gtk/gtkcssanimatedstyle.c

index ece7037bc67d923fb8db20bf71ddd0cffd4dedae..4aa82c0fe94419235849154f3c1191263aaf4911 100644 (file)
@@ -203,8 +203,14 @@ transition_info_add (TransitionInfo    infos[GTK_CSS_PROPERTY_N_PROPERTIES],
       for (i = 0; i < len; i++)
         {
           GtkCssStyleProperty *prop = _gtk_css_shorthand_property_get_subproperty (shorthand, i);
+          guint id;
 
-          transition_info_add (infos, (GtkStyleProperty *)prop, index);
+          if (!_gtk_css_style_property_is_animated ((GtkCssStyleProperty *) prop))
+            continue;
+
+          id = _gtk_css_style_property_get_id ((GtkCssStyleProperty *) prop);
+          infos[id].index = index;
+          infos[id].pending = TRUE;
         }
     }
   else